package com.ia2014.tp.portal2.dto;

import java.io.Serializable;

import javax.persistence.Column;

import com.ia2014.tp.portal2.entity.Logistica;

/**
 * DTO de Logistica
 * @author Liliana Gonzalez
 *
 */
public class LogisticaDto implements Serializable{

	private static final long serialVersionUID = 6367339097837817153L;
	
	private Integer idModulo;
	
	private String ipAddress;
	
	private String descripcion;
	
	private boolean sincronico;
	
	private String url;
	
	private String colaJMS;
	
	private String userJMS;
	
	private String passJMS;
	
	public LogisticaDto() {
		clean();
	}


	public LogisticaDto(Integer idModulo, String ipAddress, String descripcion,
			boolean sincronico, String cola, String url, String userJMS, String passJMS) {
		super();
		this.idModulo = idModulo;
		this.ipAddress = ipAddress;
		this.descripcion = descripcion;
		this.sincronico = sincronico;
		this.colaJMS= cola;
		this.url=url;
		this.userJMS = userJMS;
		this.passJMS = passJMS;
	}
	
	/**
	 * Convierte a LogisticaDto
	 * @param logistica
	 */
	public LogisticaDto(Logistica logistica){
		
		this.idModulo = logistica.getIdModulo();
		this.ipAddress = logistica.getIpAddress();
		this.descripcion = logistica.getDescripcion();
		this.sincronico = logistica.getSincronico();
		this.colaJMS= logistica.getColaJMS();
		this.url= logistica.getUrl();
		this.userJMS = logistica.getUserJMS();
		this.passJMS = logistica.getPassJMS();
	}

	/**
	 * Convierte de LogisticaDto a Logistica
	 * @param logisticaDto
	 * @return
	 */
	 public static  Logistica toLogisticaEntity(LogisticaDto logisticaDto){
		 
		 Logistica logistica= new Logistica();
		 logistica.setIdModulo(logisticaDto.getIdModulo());
		 logistica.setDescripcion(logisticaDto.getDescripcion());
		 logistica.setIpAddress(logisticaDto.getIpAddress());
		 logistica.setSincronico(logisticaDto.sincronico);
		 logistica.setColaJMS(logisticaDto.getColaJMS());
		 logistica.setUrl(logisticaDto.getUrl());
		 
		 logistica.setUserJMS(logisticaDto.getUserJMS());
		 logistica.setPassJMS(logisticaDto.getPassJMS());
		 
		 return logistica;
	 }

	public Integer getIdModulo() {
		return idModulo;
	}


	public void setIdModulo(Integer idModulo) {
		this.idModulo = idModulo;
	}


	public String getIpAddress() {
		return ipAddress;
	}


	public void setIpAddress(String ipAddress) {
		this.ipAddress = ipAddress;
	}


	public String getDescripcion() {
		return descripcion;
	}


	public void setDescripcion(String descripcion) {
		this.descripcion = descripcion;
	}


//	public boolean isSincronico() {
//		return sincronico;
//	}

	public Boolean getSincronico() {
		return sincronico;
	}

	public void setSincronico(boolean sincronico) {
		this.sincronico = sincronico;
	}
	
	
	
	
	public String getUrl() {
		return url;
	}


	public void setUrl(String url) {
		this.url = url;
	}


	public String getColaJMS() {
		return colaJMS;
	}


	public void setColaJMS(String colaJMS) {
		this.colaJMS = colaJMS;
	}


	public String getUserJMS() {
		return userJMS;
	}


	public void setUserJMS(String userJMS) {
		this.userJMS = userJMS;
	}


	public String getPassJMS() {
		return passJMS;
	}


	public void setPassJMS(String passJMS) {
		this.passJMS = passJMS;
	}


	/**
	 * Limpia el Objeto Dto
	 */
	public void clean(){
		this.descripcion="";
		this.idModulo=0;
		this.ipAddress="";
		this.sincronico=false;
		this.colaJMS= "";
		this.url="";
		this.userJMS = "";
		this.passJMS = "";
	}
}
